<script lang="ts" setup>
import { ref } from 'vue'
import axios from 'axios'
import { TChannelItem, TResponse } from '../types'
const channelList = ref<TChannelItem[]>([])
const getList = async () => {
  const r = await axios.get<TResponse<{ channels: TChannelItem[] }>>('http://geek.itheima.net/v1_0/channels')
  channelList.value = r.data.data.channels
}
getList()
</script>

<template>
  <ul class="catagtory">
    <li class="select" v-for="item in channelList" :key="item.id">{{item.name}}</li>
  </ul>
</template>

<style scoed lang="less"></style>
